const getDictListByType = '/admin/dict/getDictListByType/'
const getUserAll = '/admin/user/getUserAll'
const getEquipmentManufacturerAll = '/pbms/arcmanufacturer/getEquipmentManufacturerAll'

export const tableOption = {
  "border": true,
  "index": true,
  "indexLabel": "序号",
  "stripe": true,
  "menuAlign": "center",
  "align": "center",
  "searchMenuSpan": 6,
  "column": [
    {
      "type": "select",
      "label": "温室",
      "prop": "houseId",
      "span": 12,
      rules: [
        { required: true, message: '请选择温室', trigger: 'blur' }
      ],
      "dicUrl": '/pbms/archouse/getAllHouse',
      props: {
        label: 'houseName',
        value: 'houseId'
      },
      'search': true,
    }, {
      "type": "input",
      "label": "设备名称",
      "prop": "equipmentName",
      "span": 12,
      rules: [
        { required: true, message: '设备名称不能为空', trigger: 'blur' },
        { min: 2, max: 60, message: '长度在 2 到 60 个字符', trigger: 'blur' }
      ],
    }, {
      "type": "select",
      "label": "设备类型",
      "prop": "equipmentTypeCode",
      "span": 12,
      rules: [
        { required: true, message: '请选择设备类型', trigger: 'blur' }
      ],
      "dicUrl": '/pbms/arcequipmenttype/getEquipmentTypeAll',
      props: {
        label: 'equipmentName',
        value: 'equipmentTypeCode'
      },
      'search': true,
    }, {
      "type": "input",
      "label": "识别码",
      "prop": "identificationCode",
      "span": 12,
      rules: [
        { required: true, message: '设备识别码不能为空', trigger: 'blur' },
        { min: 2, max: 60, message: '长度在 2 到 60 个字符', trigger: 'blur' }
      ],
    }, {
      "type": "input",
      "label": "设备编码",
      "prop": "equipmentCode",
      "span": 12,
      rules: [
        { required: true, message: '设备编码不能为空', trigger: 'blur' },
        { min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' }
      ],
    }, {
      "type": "input",
      "label": "节点地址",
      "prop": "nodeAddress",
      "span": 12
    }, {
      "type": "select",
      "label": "设备厂商",
      "prop": "manufacturerCode",
      "span": 12,
      rules: [
        { required: true, message: '请选择设备厂商', trigger: 'blur' }
      ],
      cascaderItem: ['modelCode'],
      "dicUrl": getEquipmentManufacturerAll,
      props: {
        id: 'manufacturerId',
        label: 'manufacturerName',
        value: 'manufacturerCode'
      },
      
    }, {
      "type": "select",
      "label": "设备型号",
      "prop": "modelCode",
      "span": 12,
      rules: [
        { required: true, message: '请选择设备型号', trigger: 'blur' }
      ],
      "dicUrl": '/pbms/arcmodel/getListByManufacturerId/{{key}}',
      props: {
        label: 'modelName',
        value: 'modelCode'
      },
    }, {
      "type": "select",
      "label": "设备状态",
      "prop": "status",
      "span": 12,
      'search': true,
      "dataType": "number",
      rules: [
        { required: true, message: '请选择设备状态', trigger: 'blur' }
      ],
      "dicUrl": getDictListByType + "arc_equipment_status",
      props: {
        label: 'label',
        value: 'value',
      }
    }, {
      "type": "select",
      "label": "启用状态",
      "prop": "runStatus",
      "span": 12,
      'search': true,
      rules: [
        { required: true, message: '请选择启用状态', trigger: 'blur' }
      ],
      dicData: [{
        label: '启用',
        value: 1
      }, {
        label: '停用',
        value: 0
      }]
    }, {
      "type": "input",
      "label": "用户名",
      "prop": "userName",
      "span": 12,
      showClomnu: false,
      hide: true
    }, {
      "type": "input",
      "label": "密码",
      "prop": "password",
      "span": 12,
      showClomnu: false,
      hide: true
    }, {
      "type": "input",
      "label": "是否删除",
      "prop": "delFlag",
      "span": 12,
      editDisplay: false,
      addDisplay: false,
      showClomnu: false,
      hide: true
    },	  {
      "type": "input",
      "label": "创建时间",
      "prop": "createTime",
      "span": 12,
      editDisplay: false,
      addDisplay: false,
      showClomnu: false,
      hide: true
    },	  {
      "type": "input",
      "label": "创建人",
      "prop": "createUser",
      "span": 12,
      editDisplay: false,
      addDisplay: false,
      showClomnu: false,
      hide: true,
      "dicUrl": getUserAll,
      props: {
        label: 'username',
        value: 'userId'
      }
    },	  {
      "type": "input",
      "label": "修改时间",
      "prop": "updateTime",
      "span": 12,
      editDisplay: false,
      addDisplay: false,
      showClomnu: false,
      hide: true
    },	  {
      "type": "input",
      "label": "修改人",
      "prop": "updateUser",
      "span": 12,
      editDisplay: false,
      addDisplay: false,
      showClomnu: false,
      hide: true
    }  ]
}

export const tableEquipmentItemHistoryOption = {
  "border": true,
  "index": true,
  "indexLabel": "序号",
  "stripe": true,
  "menuAlign": "center",
  "align": "center",
  "searchMenuSpan": 6,
  "column": [
    {
      "type": "input",
      "label": "设备历史id",
      "prop": "historyId",
      "span": 12,
      editDisplay: false,
      addDisplay: false,
      showClomnu: false,
      hide: true
    }, {
      "type": "input",
      "label": "设备id",
      "prop": "equipmentId",
      "span": 12
    }, {
      "type": "input",
      "label": "温室id",
      "prop": "houseId",
      "span": 12
    }, {
      "type": "input",
      "label": "设备名称",
      "prop": "equipmentName",
      "span": 12
    }, {
      "type": "input",
      "label": "设备识别码",
      "prop": "identificationCode",
      "span": 12
    }, {
      "type": "input",
      "label": "设备编码",
      "prop": "equipmentCode",
      "span": 12
    }, {
      "type": "input",
      "label": "设备类型编码",
      "prop": "equipmentTypeCode",
      "span": 12
    }, {
      "type": "input",
      "label": "型号编码",
      "prop": "modelCode",
      "span": 12
    }, {
      "type": "input",
      "label": "厂商编码",
      "prop": "manufacturerCode",
      "span": 12
    }, {
      "type": "select",
      "label": "设备状态",
      "prop": "status",
      "span": 12,
      rules: [
        { required: true, message: '请选择设备状态', trigger: 'blur' }
      ],
      dicData: [{
        label: '使用',
        value: 1
      }, {
        label: '在库',
        value: 2
      }, {
        label: '报废',
        value: 3
      }, {
        label: '丢失',
        value: 4
      }],
      'search': true,
    }, {
      "type": "select",
      "label": "启用状态",
      "prop": "runStatus",
      "span": 12,
      'search': true,
      rules: [
        { required: true, message: '请选择启用状态', trigger: 'blur' }
      ],
      dicData: [{
        label: '启用',
        value: 1
      }, {
        label: '停用',
        value: 0
      }]
    }, {
      "type": "input",
      "label": "用户名",
      "prop": "userName",
      "span": 12
    }, {
      "type": "input",
      "label": "密码",
      "prop": "password",
      "span": 12
    }, {
      "type": "input",
      "label": "是否删除",
      "prop": "delFlag",
      "span": 12,
      editDisplay: false,
      addDisplay: false,
      showClomnu: false,
      hide: true
    }, {
      "type": "input",
      "label": "创建时间",
      "prop": "createTime",
      "span": 12,
      editDisplay: false,
      addDisplay: false,
      showClomnu: false,
      hide: true
    }, {
      "type": "input",
      "label": "创建人",
      "prop": "createUser",
      "span": 12,
      editDisplay: false,
      addDisplay: false,
      showClomnu: false,
      hide: true
    }, {
      "type": "input",
      "label": "修改时间",
      "prop": "updateTime",
      "span": 12
    }, {
      "type": "input",
      "label": "修改人",
      "prop": "updateUser",
      "span": 12
    }, {
      "type": "input",
      "label": "修改人ip地址",
      "prop": "ip",
      "span": 12
    }]
}
